<?php   
// ini_set('display_errors',1);
my_component_load('testing' , false);
my_component_load('xl_builder' , false);
my_component_load('paging' , false);    
my_component_load('yi_rpt_komponen_data' );
$task = isset($_GET['task']) ? $_GET['task'] : "";  
$tanggal = isset($_GET['tanggal']) ? $_GET['tanggal'] : "";  
$tahun = isset($_GET['tahun']) ? $_GET['tahun'] : "";   
$value = isset($_GET['value']) ? $_GET['value'] : "";   
$pr_yearly_income_id= isset( $_GET['pr_yearly_income_id'] ) ? (int) $_GET['pr_yearly_income_id'] : get_pr_yearly_income_id(); 
$komponen_id = isset( $_GET['komponen_id'] ) ? $_GET['komponen_id']:  0;
$yearly_income_id = isset( $_GET['yearly_income_id'] ) ? $_GET['yearly_income_id']:  0;
$karyawan_id = isset( $_GET['karyawan_id'] ) ? $_GET['karyawan_id']:  0;


$pagename = "Komponen Yearly Income ";
if($task == 'excel_list_komponen'){
	header("Content-Type: application/xls");;
	header("Content-Disposition: attachment;filename=rpt_yearly_income_komponen_".rand(1000,9999).".xls");
	echo excel_list_komponen($pr_yearly_income_id);
	exit;
}elseif($task == 'cetak_komponen_detail'){
	include_once('components/'.$_GET['com'].'/cetak.'.$_GET['com'].'.php');
	cetak_laporan($komponen_id   , $pr_yearly_income_id) ;
	exit;
}elseif($task == 'excel_list_komponen_detail'){

	$komponen = my_get_data_by_id('pr_yearly_income_komponen','komponen_id', (int) $komponen_id); 
	header("Content-Type: application/xls");;
	header("Content-Disposition: attachment;filename=rpt_yearly_income_komponen_detail_".str_replace(" ","_",$komponen['label'])."_".rand(1000,9999).".xls");
	echo excel_list_komponen_detail($komponen_id , $pr_yearly_income_id);
	exit;
}elseif($task == 'detail_komponen'){
	$content = list_komponen_detail((int) $komponen_id , (int) $pr_yearly_income_id );
}else{
	$content = list_komponen(  $pr_komponen_id);
}

generate_my_web($content , $pagename );